package com.hl.service.impl;

import java.util.List;

import com.hl.domain.timeSegment;
import com.hl.domain.ActivityProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hl.mapper.SeckillActivitiesMapper;
import com.hl.domain.SeckillActivities;
import com.hl.service.ISeckillActivitiesService;

/**
 * 秒杀活动Service业务层处理
 * 
 * @author vv
 * @date 2025-08-08
 */
@Service
public class SeckillActivitiesServiceImpl implements ISeckillActivitiesService 
{
    @Autowired
    private SeckillActivitiesMapper seckillActivitiesMapper;

    /**
     * 查询秒杀活动
     * 
     * @param id 秒杀活动主键
     * @return 秒杀活动
     */
    @Override
    public SeckillActivities selectSeckillActivitiesById(String id)
    {
        return seckillActivitiesMapper.selectSeckillActivitiesById(id);
    }

    /**
     * 查询秒杀活动列表
     * 
     * @param seckillActivities 秒杀活动
     * @return 秒杀活动
     */
    @Override
    public List<SeckillActivities> selectSeckillActivitiesList(SeckillActivities seckillActivities)
    {
        return seckillActivitiesMapper.selectSeckillActivitiesList(seckillActivities);
    }

    /**
     * 新增秒杀活动
     * 
     * @param seckillActivities 秒杀活动
     * @return 结果
     */
    @Override
    public int insertSeckillActivities(SeckillActivities seckillActivities)
    {
        return seckillActivitiesMapper.insertSeckillActivities(seckillActivities);
    }

    @Override
    public int insertTimeSegment(timeSegment timeSegment) {
        return seckillActivitiesMapper.insertTimeSegment(timeSegment);
    }

    @Override
    public List<timeSegment> selectTimeSegmentsByActivityId(String activityId) {
        return seckillActivitiesMapper.selectTimeSegmentsByActivityId(activityId);
    }

    /**
     * 修改秒杀活动
     * 
     * @param seckillActivities 秒杀活动
     * @return 结果
     */
    @Override
    public int updateSeckillActivities(SeckillActivities seckillActivities)
    {
        return seckillActivitiesMapper.updateSeckillActivities(seckillActivities);
    }

    /**
     * 批量删除秒杀活动
     * 
     * @param ids 需要删除的秒杀活动主键
     * @return 结果
     */
    @Override
    public int deleteSeckillActivitiesByIds(String[] ids)
    {
        return seckillActivitiesMapper.deleteSeckillActivitiesByIds(ids);
    }

    /**
     * 删除秒杀活动信息
     * 
     * @param id 秒杀活动主键
     * @return 结果
     */
    @Override
    public int deleteSeckillActivitiesById(String id)
    {
        return seckillActivitiesMapper.deleteSeckillActivitiesById(id);
    }
    @Override
    public int deleteTimeSegment(String id) {
        return seckillActivitiesMapper.deleteTimeSegment(id);
    }

    // ==================== ActivityProduct业务实现 ====================

    /**
     * 查询活动商品
     * 
     * @param id 活动商品主键
     * @return 活动商品
     */
    @Override
    public ActivityProduct selectActivityProductById(String id)
    {
        return seckillActivitiesMapper.selectActivityProductById(id);
    }

    /**
     * 根据活动ID查询活动商品列表
     * 
     * @param activityId 活动ID
     * @return 活动商品集合
     */
    @Override
    public List<ActivityProduct> selectActivityProductByActivityId(String activityId)
    {
        return seckillActivitiesMapper.selectActivityProductByActivityId(activityId);
    }

    /**
     * 查询活动商品列表
     * 
     * @param activityProduct 活动商品
     * @return 活动商品集合
     */
    @Override
    public List<ActivityProduct> selectActivityProductList(ActivityProduct activityProduct)
    {
        return seckillActivitiesMapper.selectActivityProductList(activityProduct);
    }

    /**
     * 新增活动商品
     * 
     * @param activityProduct 活动商品
     * @return 结果
     */
    @Override
    public int insertActivityProduct(ActivityProduct activityProduct)
    {
        return seckillActivitiesMapper.insertActivityProduct(activityProduct);
    }

    /**
     * 修改活动商品
     * 
     * @param activityProduct 活动商品
     * @return 结果
     */
    @Override
    public int updateActivityProduct(ActivityProduct activityProduct)
    {
        return seckillActivitiesMapper.updateActivityProduct(activityProduct);
    }

    /**
     * 批量删除活动商品
     * 
     * @param ids 需要删除的活动商品主键
     * @return 结果
     */
    @Override
    public int deleteActivityProductByIds(String[] ids)
    {
        return seckillActivitiesMapper.deleteActivityProductByIds(ids);
    }

    /**
     * 删除活动商品信息
     * 
     * @param id 活动商品主键
     * @return 结果
     */
    @Override
    public int deleteActivityProductById(String id)
    {
        return seckillActivitiesMapper.deleteActivityProductById(id);
    }

    /**
     * 根据活动ID删除活动商品
     * 
     * @param activityId 活动ID
     * @return 结果
     */
    @Override
    public int deleteActivityProductByActivityId(String activityId)
    {
        return seckillActivitiesMapper.deleteActivityProductByActivityId(activityId);
    }
}
